package com.bjpowernode.seckillweb.service.impl;

import com.bjpowernode.constant.Constants;
import com.bjpowernode.entity.Orders;
import com.bjpowernode.seckillweb.service.OrderService;
import jakarta.annotation.Resource;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {
    @Resource
    private RedisTemplate<String, Object> redisTemplate;

    @Override
    public Orders queryResult(Integer userId, Integer goodsId) {
        return (Orders) redisTemplate.opsForValue().get(Constants.REDIS_RESULT + goodsId + ":" + userId);
    }
}